using Microsoft.Extensions.Configuration;

namespace JamesFan.FetchAreaCodes.Cli;

class DbConfiguration {
    public static DbConfiguration Load(string filePath) {
        return new ConfigurationBuilder()
            .AddJsonFile(filePath, false)
            .Build()
            .Get<DbConfiguration>();
    }

    public string? Server { get; set; }
    public uint Port { get; set; }
    public string? Database { get; set; }
    public string? Username { get; set; }
    public string? Password { get; set; }
    public string? Charset { get; set; }
}
